*Program to create dta file for model on the quarterly data

/*
*Run this block if stand alone. If commented out, it is because this will be run from _ricardo_master.do
set more off, perm
clear
graph drop _all
local dir "/Users/rreis/Dropbox/05Shared_folders/HRR/HRR_InflDisaster/Ricardo"  // RR's directory
*local dir "C:\Users\marin\Dropbox\HRR_InflDisaster\Ricardo"  // Marina's directory
cd `dir'
local region = "EZ" 	// set region US or EZ
*/

local region `1'

* Create dataset with model estimates
******************************
*Read off model estimates
clear
import excel "$input/prob_avginfl_monthly.xlsx", sheet("`region'_model_101_month") cellrange(A2) firstrow clear

generate date_ym = ym(year, month)
format %tm date_ym
order date_ym

label variable y5y_def_0_4 		"Model 101 estimate of deflation"
label variable y5y_hyp_0_4 		"Model 101 estimate of infation"
label variable y5y_def_m1_5 	"Model 101 estimate of serious deflation"
label variable y5y_hyp_m1_5 	"Model 101 estimate of serious infation"
drop next*
  // Daniel prodcued these in simulations, not used right now

rename y5y_def_0_4 tail0_5y5y
rename y5y_hyp_0_4 tail4_5y5y
rename y5y_def_m1_5 tailm1_5y5y
rename y5y_hyp_m1_5 tail5_5y5y

sleep 100
save "$input/`region'_55tails_monthly.dta", replace
